package model

import (
	"gorm.io/gorm"
	"time"
)

type Bullets struct {
	Id          uint           `gorm:"column:id;type:bigint UNSIGNED;comment:id;primaryKey;not null;" json:"id"`              // id
	UserId      uint           `gorm:"column:user_id;type:bigint UNSIGNED;comment:用户id;not null;default:0;" json:"user_id"`   // 用户id
	HouseId     uint           `gorm:"column:house_id;type:bigint UNSIGNED;comment:视频id;not null;default:0;" json:"house_id"` // 视频id
	Modes       uint           `gorm:"column:modes;type:int UNSIGNED;comment:弹幕类型;not null;default:0;" json:"modes"`          // 弹幕类型
	Text        string         `gorm:"column:text;type:varchar(30);comment:弹幕内容;not null;" json:"text"`                       // 弹幕内容
	BarrageTime time.Time      `gorm:"column:barrage_time;type:datetime(3);comment:弹幕时间;not null;" json:"barrage_time"`       // 弹幕时间
	Size        uint           `gorm:"column:size;type:int UNSIGNED;comment:弹幕大小;not null;default:0;" json:"size"`            // 弹幕大小
	Color       string         `gorm:"column:color;type:varchar(255);comment:弹幕颜色;not null;" json:"color"`                    // 弹幕颜色
	CreatedAt   time.Time      `gorm:"column:created_at;type:datetime(3);not null;" json:"created_at"`
	DeletedAt   gorm.DeletedAt `gorm:"column:deleted_at;type:datetime(3);default:NULL;" json:"deleted_at"`
}

func (b *Bullets) TableName() string {
	return "bullets"
}
